package com.lsege.controller.backstage;

import com.github.pagehelper.PageHelper;
import com.lsege.entity.JsonResult;
import com.lsege.entity.Page;
import com.lsege.entity.backstage.BakeOrder;
import com.lsege.entity.backstage.VoBike;
import com.lsege.service.backstage.BakeOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/7/7.
 */
@RestController
@RequestMapping("/bakeOrder")
public class BakeOrderController {
    @Autowired
    BakeOrderService bakeOrderService;

    /**
     * 查看单车列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("getBakeOrderList")
    public JsonResult getBakeOrderList(Integer pageNum,Integer pageSize){
        JsonResult json = new JsonResult();
        PageHelper.startPage(pageNum,pageSize);
        List<BakeOrder> list = bakeOrderService.queryBakeOrderList();
        Long total = bakeOrderService.queryBakeOrderCount();
        json.setData(new Page(list,total,pageSize,pageNum));
        json.setSuccess(true);
        json.setMessage("获取成功");
        return json;
    }
}
